package jiyici;

public class Constant {

    public static class AuthenticateKey {
        public static final String USER_ID = "userId";
        public static final String TOKEN = "token";
    }

    public static class PostAction {
        /**
         * post data json: { email: "xxx@xxx.com" userName: "jerry" password:
         * "******" }
         */
        public static final int REGISTER = 1;

        /**
         * post data json: { email: "xxx@xxx.com" password: "******" }
         */
        public static final int LOGIN = 2;

        /**
         * post data json: { userId: 0001 token: "[uuid]" data: { itemName:
         * "snooker" category: "sport" params: [{ itemParamName: "damo" type:
         * xxx isMust: yes },{...}] } }
         */
        public static final int ADD_ITEM = 3;

        /**
         * post data json: { userId: 0001, token: "[uuid]", data: { item_id:xxx,
         * recordTime:xxx, params: [{itemParam: xxx, paramType:xxx,
         * value:"xxx"},{}]}}
         */
        public static final int RECORD = 4;
    }

    public static class GetAction {

    }

    public static class ResponseSpec {
        public static int SUCCESS = 0;
        public static int FAIL = -1;
        public static String KEY_ACTION = "action";
        public static String KEY_RESULT = "result";
        public static String KEY_ERROR = "error";
        public static String KEY_DATA = "data";

        // public static String ERROR_ACTION_NOT_SUPPORTED =
        // "Action not supported.";
        // public static String ERROR_NO_REQUEST_DATA = "No request data.";
        // public static String ERROR_INVALID_DATA_FORMAT =
        // "Invalid data format.";
        // public static String ERROR_EMAIL_EXIST =
        // "The email has already been registed.";
        // public static String ERROR_LOGIN_FAILED =
        // "Invalid email or password.";
        // public static String ERROR_NOT_AUTHENTICATED = "Not authenticated.";
    }

    public static class ErrorCode {
        public static int ERROR_ACTION_NOT_SUPPORTED = 1000;
        public static int ERROR_NO_REQUEST_DATA = 1001;
        public static int ERROR_INVALID_DATA_FORMAT = 1002;
        public static int ERROR_EMAIL_EXIST = 1003;
        public static int ERROR_LOGIN_FAILED = 1004;
        public static int ERROR_NOT_AUTHENTICATED = 1005;
        public static int ERROR_SYSTEM_ERROR = 1006;
    }

    public static class ModelColumn {
        public static final String USER_COLUMN_ID = "id";
        public static final String USER_COLUMN_EMAIL = "email";
        public static final String USER_COLUMN_USERNAME = "userName";
        public static final String USER_COLUMN_PASSWORD = "password";
        public static final String USER_COLUMN_TOKEN = "token";

        public static final String ITEM_COLUMN_ID = "id";
        public static final String ITEM_COLUMN_NAME = "itemName";
        public static final String ITEM_COLUMN_CATEGORY = "category";
        public static final String ITEM_COLUMN_DISPLAY_INDEX = "displayIndex";
        public static final String ITEM_COLUMN_RECORD_COUNT = "recordCount";
        public static final String ITEM_COLUMN_PARAMS = "params";

        public static final String ITEM_PARAM_COLUMN_ID = "id";
        public static final String ITEM_PARAM_COLUMN_NAME = "itemParamName";
        public static final String ITEM_PARAM_COLUMN_TYPE = "type";
        public static final String ITEM_PARAM_COLUMN_IS_MUST = "isMust";

        public static final String RECORD_ID = "id";
        public static final String RECORD_ITEM_ID = "item_id";
        public static final String RECORD_RECORD_TIME = "recordTime";
        public static final String RECORD_PARAMS = "params";

        public static final String RECORD_PARAM_ID = "id";
        public static final String RECORD_PARAM_ITEM_PARAM_ID = "item_param_id";
        public static final String RECORD_PARAM_TYPE = "paramType";
        public static final String RECORD_PARAM_VALUE = "value";
    }

    public static class ItemParamType {
        public static final int FIRST = 1;
        public static final int TEXT = 1;
        public static final int NUMBER = 2;
        public static final int LAST = 2;
    }

}
